import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'
const RoleKey = 'Admin-Role'
export function getToken() {
  return Cookies.get(TokenKey)
}
export function setToken(token:string) {
  return Cookies.set(TokenKey, token, { expires: new Date().getTime() + 30 * 24 * 60 * 60 * 1000 })
}
export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function getRoleKey() {
  return Cookies.get(RoleKey)
}
export function setRoleKey(role:string) {
  return Cookies.set(RoleKey, role, { expires: new Date().getTime() + 30 * 24 * 60 * 60 * 1000 })
}
export function removeRoleKey() {
  return Cookies.remove(RoleKey)
}
